Skip to content

feat(linter): implement eslint/no-useless-backreference#4096

Closed
Sysix wants to merge 24 commits intooxc-project:mainfrom
Sysix:main
Closed

feat(linter): implement eslint/no-useless-backreference#4096
Sysix wants to merge 24 commits intooxc-project:mainfrom
Sysix:main

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Jul 7, 2024

This is my first work on oxc in rust. So please tell me when something can be done better.
I have already some ideas to optimize to code. For that there should me mostly a ToDo in the Code.

Currently on work:

  • Flag check for strings, see report_invalid_back_reference(s) call
  • same capture group names in alternatives
  • into a negative lookaround tests
  • report multiple invalid
  • tests, tests, tests

There are also some outcommented test. These only makes more parser work and are (in my opinion) rare.
Please check if they are needed:

  • not the global RegExp
  • invalid syntax
  • contacting variables (example p = '\\1', s = '(a)'; new RegExp(p + s); should fail)

Linter Docs:
https://eslint.org/docs/latest/rules/no-useless-backreference

@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 7, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the A-linter Area - Linter label Jul 7, 2024
@Sysix Sysix changed the title feat(linter): implement eslint/no-usless-backreference feat(linter): implement eslint/no-useless-backreference Jul 7, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 8, 2024

CodSpeed Performance Report

Merging #4096 will not alter performance

Comparing Sysix:main (299f8ee) with main (ee16668)

Summary

✅ 32 untouched benchmarks

@Sysix
Copy link
Member Author

Sysix commented Aug 1, 2024

I encountered problems with nested (negative) look-behinds/aheads.
I will wait for #3824 before reinventing the wheel.

@Sysix Sysix closed this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant